package com.eling.elcms.nursing.model;

import com.eling.elcms.checkin.model.SignUpService;
import com.eling.elcms.core.model.BaseModel;
import com.eling.elcms.travel.model.TravelContract;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;

/**
 * 权证与入住签约绑定关系
 * 
 * @author zhoulin
 *
 */
@Entity
@Indexed
@Table(name = "nurs_signupservcontr")
public class SignUpServContr extends BaseModel {

	private static final long serialVersionUID = 5837258583130850388L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@DocumentId
	private Long pkSignUpServContr;

	/** 入住签约 */
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkSignUpService")
	@IndexedEmbedded(depth = 1)
	private SignUpService signUpService;

	/** 会员证 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkTravelContract")
	@IndexedEmbedded(depth = 1)
	private TravelContract travelContract;

	@Version
	private Integer version;

	public Long getPkSignUpServContr() {
		return pkSignUpServContr;
	}

	public void setPkSignUpServContr(Long pkSignUpServContr) {
		this.pkSignUpServContr = pkSignUpServContr;
	}

	public SignUpService getSignUpService() {
		return signUpService;
	}

	public void setSignUpService(SignUpService signUpService) {
		this.signUpService = signUpService;
	}

	public TravelContract getTravelContract() {
		return travelContract;
	}

	public void setTravelContract(TravelContract travelContract) {
		this.travelContract = travelContract;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

}